<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="text" id="test" onkeyup="xxf.fun(this)" onblur="xxf.out(this)">
</body>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.xxfset.js?r=<?php echo rand()?>"></script>
<script>
var xxf={
	temp:"",
	fun:function(t){
		if(t.value!=xxf.temp&&t.value!=""){
			xxf.temp=t.value;
			$.xxpost("test",{type:"test",str:t.value},function(data){
				$("#test").xautocomplete(JSON.parse(data));
			});
		}
	},
	out:function(t){
		console.log(t);
	}
}

</script>
</html>